home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / self / contrib.lha / contrib / xlib-support / xlibPrims.h < prev    next >
C/C++ Source or Header  |  1993-05-18  |  4KB  |  119 lines

  1. /* Sun-$Revision: 8.0 $ */
  2.  
  3. /* Copyright 1992 Sun Microsystems, Inc. and Stanford University.
  4.    See the LICENSE file for license information. */
  5.  
  6. # pragma interface
  7.  
  8. # ifdef XLIB
  9.   
  10. # define xTypeSealsDo(template)                              \
  11.     template(Display)                                  \
  12.     template(Window)                                  \
  13.     template(Drawable)                                  \
  14.     template(Cursor)                                  \
  15.     template(GC)                                  \
  16.     template(XGCValues)                                  \
  17.     template(Pixmap)                                  \
  18.     template(Visual)                                  \
  19.     template(Colormap)                                  \
  20.     template(XColor)                                  \
  21.     template(Screen)                                  \
  22.     template(XEvent)                                  \
  23.     template(XButtonEvent)                              \
  24.     template(XKeyEvent)                                  \
  25.     template(XExposeEvent)                              \
  26.     template(XMotionEvent)                              \
  27.     template(XConfigureEvent)                              \
  28.     template(XClientMessageEvent)                          \
  29.     template(XVisibilityEvent)                              \
  30.     template(XCrossingEvent)                              \
  31.     template(XMapEvent)                                  \
  32.     template(XUnmapEvent)                              \
  33.     template(XColormapEvent)                              \
  34.     template(XReparentEvent)                              \
  35.     template(XAnyEvent)                                  \
  36.     template(XSizeHints)                              \
  37.     template(XEnterWindowEvent)                              \
  38.     template(XLeaveWindowEvent)                              \
  39.     template(XWMHints)                                  \
  40.     template(XTextProperty)                              \
  41.     template(XTextProperty_value)                          \
  42.     template(Atom) 
  43.  
  44. # define declareXTypeSeals(stem)                          \
  45.     extern char* CONC(stem,_seal);
  46.  
  47. # define defineXTypeSeals(stem)                              \
  48.     char* CONC(stem,_seal) = STR(stem);
  49.  
  50. xTypeSealsDo(declareXTypeSeals)
  51.  
  52.  
  53. # define XEvent_member_wraps_Do(template)                      \
  54.     template(XAnyEvent,xany)                              \
  55.     template(XButtonEvent,xbutton)                          \
  56.     template(XCirculateEvent,xcirculate)                      \
  57.     template(XCirculateRequestEvent,xcirculaterequest)                  \
  58.     template(XClientMessageEvent,xclient)                      \
  59.     template(XColormapEvent,xcolormap)                          \
  60.     template(XConfigureEvent,xconfigure)                      \
  61.     template(XConfigureRequestEvent,xconfigurerequest)                  \
  62.     template(XCreateWindowEvent,xcreatewindow)                      \
  63.     template(XCrossingEvent,xcrossing)                          \
  64.     template(XDestroyWindowEvent,xdestroywindow)                  \
  65.     template(XErrorEvent,xerror)                          \
  66.     template(XExposeEvent,xexpose)                          \
  67.     template(XFocusChangeEvent,xfocus)                          \
  68.     template(XGraphicsExposeEvent,xgraphicsexpose)                  \
  69.     template(XGravityEvent,xgravity)                          \
  70.     template(XKeyEvent,xkey)                              \
  71.     template(XKeymapEvent,xkeymap)                          \
  72.     template(XMapEvent,xmap)                              \
  73.     template(XMapRequestEvent,xmaprequest)                      \
  74.     template(XMappingEvent,xmapping)                          \
  75.     template(XMotionEvent,xmotion)                          \
  76.     template(XNoExposeEvent,xnoexpose)                          \
  77.     template(XPropertyEvent,xproperty)                          \
  78.     template(XReparentEvent,xreparent)                          \
  79.     template(XResizeRequestEvent,xresizerequest)                  \
  80.     template(XSelectionClearEvent,xselectionclear)                  \
  81.     template(XSelectionEvent,xselection)                      \
  82.     template(XSelectionRequestEvent,xselectionrequest)                  \
  83.     template(XUnmapEvent,xunmap)                          \
  84.     template(XVisibilityEvent,xvisibility)
  85.  
  86.  
  87. # define declare_XEvent_member_wrap(type,member)                  \
  88.     type* CONC3(get_,member,_wrap) (XEvent*);                      
  89.  
  90. # define define_XEvent_member_wrap(type,member)                      \
  91.     type* CONC3(get_,member,_wrap) (XEvent* e) {return & e->member;}
  92.  
  93. XEvent_member_wraps_Do(declare_XEvent_member_wrap)
  94.  
  95.  
  96.   Display*  XOpenDisplay_wrap(   char*,    void*);
  97.   void      XCloseDisplay_wrap(  Display*  display);
  98.   int       XSetWMProtocol_wrap( Display*, Window, Atom);
  99.  
  100.   void XQueryColors_wrap( Display*, Colormap, objVectorOop, void*);           
  101.   void XStoreColors_wrap( Display*, Colormap, objVectorOop, void*);     
  102.  
  103.   Atom XClientMessageEvent_atomAt_wrap(XClientMessageEvent*,
  104.                                        unsigned int        ,
  105.                                        void*               );
  106.  
  107.   int XStringToTextProperty_wrap(XTextProperty*, char*);
  108.  
  109.   inline void XFree_XSizeHints_wrap(XSizeHints *p) {XFree((char*)p);}
  110.   inline void XFree_XWMHints_wrap  (XWMHints   *p) {XFree((char*)p);}
  111.  
  112.   inline XEvent* asXEvent(XEvent* e) {return e;}
  113.  
  114.  
  115. # define   WHAT_GLUE PROTOTYPES
  116.   xlib_glue
  117. # undef WHAT_GLUE
  118. # endif
  119.